package btanalyzer.db.model;

import java.util.HashSet;
import java.util.Set;

import javax.validation.constraints.NotNull;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="ANNOUNCE_URL")
public class AnnounceUrl {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq")
	@SequenceGenerator(name="seq", sequenceName="ANNOUNCE_URL_SEQ")
	@Column(name="ANNOUNCE_URL_ID")
	private Long id;
	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}

    @NotNull
    @Column(name="URL", unique = true)
    private String url;
    public void setUrl(String url) {
		this.url = url;
	}
    public String getUrl() {
		return url;
	}
    
    @OneToMany(mappedBy="announceUrl")
    Set<MetadataAnnounceUrl> metadataAnnounceUrls = new HashSet<MetadataAnnounceUrl>();
    public void setMetadataAnnounceUrls(
			Set<MetadataAnnounceUrl> metadataAnnounceUrls) {
		this.metadataAnnounceUrls = metadataAnnounceUrls;
	}
    public Set<MetadataAnnounceUrl> getMetadataAnnounceUrls() {
		return metadataAnnounceUrls;
	}
    
}
